package com.working.libcommon.exts

import androidx.annotation.IdRes
import androidx.fragment.app.Fragment
import androidx.navigation.NavGraphBuilder
import androidx.navigation.fragment.FragmentNavigatorDestinationBuilder
import androidx.navigation.get
import com.working.libcommon.navigation.ReusingFragmentNavigator

inline fun <reified F : Fragment> NavGraphBuilder.fragmentReusing(@IdRes id: Int) {
    destination(
        FragmentNavigatorDestinationBuilder(
            provider[ReusingFragmentNavigator::class],
            id,
            F::class
        )
    )
}